<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <!-- MOTW-DISABLED saved from url=(0014)about:internet -->
    <title>BirtDuration</title>
    <link rel="StyleSheet" href="css/ScriptingReference.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="webworks.css" type="text/css" media="all" />
    <script type="text/javascript" language="JavaScript1.2">
      <!--
        var  WebWorksRootPath = "";
      // -->
    </script>
  </head>
  <body>
    <div style="text-align: left;">
      <table cellspacing="0" summary="">
        <tr>
          <td>
            <a href="ScriptingReference.24.4.html"><img src="images/prev.gif" alt="Previous" border="0" /></a>
          </td>
          <td>
            <a href="ScriptingReference.24.6.html"><img src="images/next.gif" alt="Next" border="0" /></a>
          </td>
        </tr>
      </table>
    </div>
    <hr align="left" />
    <blockquote>
      <h2 class="RH1_Class">Class  <a name="322273">BirtDuration</a></h2>
      <p class="b_Body"><a name="322274">The BirtDuration class provides functions to get parts of time periods, or durations, used in XML documents. The durations are specified in the following form:</a></p>
      <div class="cfb_CodeFirst_Break"><a name="317618">P</a><em class="Italic">n</em>Y<em class="Italic">n</em>M<em class="Italic">n</em>DT<em class="Italic">n</em>H<em class="Italic">n</em>M<em class="Italic">n</em>S</div>
      <p class="b_Body"><a name="317629">where:</a></p>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><a name="317218">P indicates the period (required)</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><em class="Italic" style="font-family: &quot;Microsoft Sans Serif&quot;; font-size: 9.0pt"><a name="317235">n</a></em>Y indicates the number of years</div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><em class="Italic" style="font-family: &quot;Microsoft Sans Serif&quot;; font-size: 9.0pt"><a name="317242">n</a></em>M indicates the number of months</div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><em class="Italic" style="font-family: &quot;Microsoft Sans Serif&quot;; font-size: 9.0pt"><a name="317249">n</a></em>D indicates the number of days</div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><a name="317256">T indicates the start of a time section (required if the duration includes hours, minutes, or seconds)</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><em class="Italic" style="font-family: &quot;Microsoft Sans Serif&quot;; font-size: 9.0pt"><a name="317263">n</a></em>H indicates the number of hours</div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><em class="Italic" style="font-family: &quot;Microsoft Sans Serif&quot;; font-size: 9.0pt"><a name="321336">n</a></em>M indicates the number of minutes</div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><em class="Italic" style="font-family: &quot;Microsoft Sans Serif&quot;; font-size: 9.0pt"><a name="321337">n</a></em>S indicates the number of seconds</div>
            </td>
          </tr>
        </table>
      </div>
      <p class="b_Body"><a name="321338">For example, the following value indicates a duration of 2 years, 3 months, and 5 days:</a></p>
      <div class="cfb_CodeFirst_Break"><a name="317581">P2Y3M5D</a></div>
      <p class="b_Body"><a name="317652">The following value indicates a duration of 10 hours:</a></p>
      <div class="cfb_CodeFirst_Break"><a name="317608">PT10H</a></div>
      <p class="b_Body"><a name="317674">The BirtDuration class is static. The application cannot create instances of the class.</a></p>
      <h3 class="RH2_Method"><a name="349842">BirtDuration.add</a></h3>
      <p class="b_Body"><a name="349843">This function adds two durations together, and returns the sum.</a></p>
      <p class="N_sb_ScanBold"><a name="349844">Syntax</a></p>
      <div class="rs_RSyntax"><a name="349845">string BirtDuration.add(string lexicalDuration1, string lexicalDuration2)</a></div>
      <p class="N_sb_ScanBold"><a name="349846">Parameters</a></p>
      <p class="RParameter"><a name="349847">lexicalDuration1</a></p>
      <p class="bn_BodyNoLead"><a name="349848">String. The first duration to add.</a></p>
      <p class="RParameter"><a name="349849">lexicalDuration2</a></p>
      <p class="bn_BodyNoLead"><a name="349850">String. The second duration to add.</a></p>
      <p class="N_sb_ScanBold"><a name="349851">Returns</a></p>
      <p class="b_Body"><a name="349852">String. The sum of the two input durations.</a></p>
      <p class="N_sb_ScanBold"><a name="349853">Examples</a></p>
      <p class="b_Body"><a name="349854">The following example adds two durations:</a></p>
      <div class="cf_CodeFirst"><a name="349855">BirtDuration.add("P1Y3M", "P13M") // returns P2Y4M</a></div>
      <h3 class="RH2_Method"><a name="350314">BirtDuration.addTo</a></h3>
      <p class="b_Body"><a name="350315">This function adds a duration to a specified Date object.</a></p>
      <p class="N_sb_ScanBold"><a name="350316">Syntax</a></p>
      <div class="rs_RSyntax"><a name="350317">Date BirtDuration.add(string lexicalDuration, Date date)</a></div>
      <p class="N_sb_ScanBold"><a name="350318">Parameters</a></p>
      <p class="RParameter"><a name="350319">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="350320">String. The duration to add.</a></p>
      <p class="RParameter"><a name="350321">date</a></p>
      <p class="bn_BodyNoLead"><a name="350322">Date object. The date and time to modify.</a></p>
      <p class="N_sb_ScanBold"><a name="350323">Returns</a></p>
      <p class="b_Body"><a name="350324">Date object. The date advanced by the duration.</a></p>
      <p class="N_sb_ScanBold"><a name="350325">Examples</a></p>
      <p class="b_Body"><a name="350413">The following example adds one year to today’s date and time:</a></p>
      <div class="cf_CodeFirst"><a name="350414">var today = new Date();</a></div>
      <div class="co_Code"><a name="350420">var annualDate = BirtDuration.addTo(today, "P1Y") </a></div>
      <h3 class="RH2_Method"><a name="350439">BirtDuration.compare</a></h3>
      <p class="b_Body"><a name="350440">This function tests if a duration is the same, greater than, or less than another duration.</a></p>
      <p class="N_sb_ScanBold"><a name="350441">Syntax</a></p>
      <div class="rs_RSyntax"><a name="350442">integer BirtDuration.compare(string lexicalDuration1, string lexicalDuration2)</a></div>
      <p class="N_sb_ScanBold"><a name="350443">Parameters</a></p>
      <p class="RParameter"><a name="350444">lexicalDuration1</a></p>
      <p class="bn_BodyNoLead"><a name="350445">String. The first duration to use in the comparison.</a></p>
      <p class="RParameter"><a name="350446">lexicalDuration2</a></p>
      <p class="bn_BodyNoLead"><a name="350447">String. The second duration to use in the comparison.</a></p>
      <p class="N_sb_ScanBold"><a name="350448">Returns</a></p>
      <p class="b_Body"><a name="350449">Integer. Partial order relation between the two durations. Returns 1 if the first duration is greater, 0 if they are equal and -1 if the second duration is greater.</a></p>
      <p class="N_sb_ScanBold"><a name="350450">Examples</a></p>
      <p class="b_Body"><a name="350451">The following expressions compare the lengths of specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="350452">BirtDuration.compare("P1Y", "P12M"); // returns 0</a></div>
      <div class="co_Code"><a name="350453">BirtDuration.compare( "P3M" ,  "P100D" ) // returns -1</a></div>
      <div class="co_Code"><a name="350454">BirtDuration.compare( "PT25H" ,  "P1D" ) // returns 1</a></div>
      <h3 class="RH2_Method"><a name="316868">BirtDuration.day</a></h3>
      <p class="b_Body"><a name="316869">This function returns the days value of a given duration.</a></p>
      <p class="N_sb_ScanBold"><a name="316870">Syntax</a></p>
      <div class="rs_RSyntax"><a name="316871">integer BirtDuration.day( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="316872">Parameter</a></p>
      <p class="RParameter"><a name="316873">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="316874">String. A duration from which to get the days value.</a></p>
      <p class="N_sb_ScanBold"><a name="316877">Returns</a></p>
      <p class="b_Body"><a name="316878">An integer that represents the days value of the specified duration.</a></p>
      <p class="N_sb_ScanBold"><a name="316879">Examples</a></p>
      <p class="b_Body"><a name="317732">The following examples show the day values returned for specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="317733">BirtDuration.day( "P1Y15DT12H" ) // returns 15</a></div>
      <div class="co_Code"><a name="320246">BirtDuration.day( "P5Y2M" ) // returns 0</a></div>
      <h3 class="RH2_Method"><a name="356229">BirtDuration.getSign</a></h3>
      <p class="b_Body"><a name="356230">This function returns the sign of a duration.</a></p>
      <p class="N_sb_ScanBold"><a name="356231">Syntax</a></p>
      <div class="rs_RSyntax"><a name="356232">integer BirtDuration.getSign( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="356233">Parameters</a></p>
      <p class="RParameter"><a name="356234">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="356235">String. The duration to analyze.</a></p>
      <p class="N_sb_ScanBold"><a name="356238">Returns</a></p>
      <p class="b_Body"><a name="356239">Integer. The sign of the duration as a multiplier. Returns 1 for a positive duration, -1 for a negative duration, and 0 for null or 0 value.</a></p>
      <p class="N_sb_ScanBold"><a name="356240">Examples</a></p>
      <p class="b_Body"><a name="356241">The following expression analyzes the sings of a specific duration:</a></p>
      <div class="cf_CodeFirst"><a name="356242">BirtDuration.getSign("P0Y"); // returns 0</a></div>
      <div class="co_Code"><a name="356868">BirtDuration.getSign("-P8Y2M3D"); // returns -1</a></div>
      <h3 class="RH2_Method"><a name="320437">BirtDuration.hour</a></h3>
      <p class="b_Body"><a name="320438">This function returns the hours value of a given duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320439">Syntax</a></p>
      <div class="rs_RSyntax"><a name="320440">integer BirtDuration.hour( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="320441">Parameter</a></p>
      <p class="RParameter"><a name="320442">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="320443">String. A duration from which to get the hours value.</a></p>
      <p class="N_sb_ScanBold"><a name="320444">Returns</a></p>
      <p class="b_Body"><a name="320445">An integer that represents the hours value of the specified duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320446">Examples</a></p>
      <p class="b_Body"><a name="320447">The following examples show the hour values returned for specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="320448">BirtDuration.hour( "P1Y15DT12H" ) // returns 12</a></div>
      <div class="co_Code"><a name="320449">BirtDuration.hour( "P5Y2M" ) // returns 0</a></div>
      <h3 class="RH2_Method"><a name="321505">BirtDuration.isLongerThan</a></h3>
      <p class="b_Body"><a name="321506">This function tests if a duration is longer than another duration. Sometimes the order relationship between certain durations cannot be determined, for example, one month (P1M) and 30 days (P30D), or one year (P1Y) and 365 days (P365D). In cases such as these, the function returns false.</a></p>
      <p class="N_sb_ScanBold"><a name="321507">Syntax</a></p>
      <div class="rs_RSyntax"><a name="321508">boolean BirtDuration.isLongerThan( string lexicalDuration1, string lexicalDuration2 )</a></div>
      <p class="N_sb_ScanBold"><a name="321509">Parameters</a></p>
      <p class="RParameter"><a name="321510">lexicalDuration1</a></p>
      <p class="bn_BodyNoLead"><a name="321511">String. The first duration to use in the comparison.</a></p>
      <p class="RParameter"><a name="321512">lexicalDuration2</a></p>
      <p class="bn_BodyNoLead"><a name="321513">String. The second duration to use in the comparison.</a></p>
      <p class="N_sb_ScanBold"><a name="321514">Returns</a></p>
      <p class="b_Body"><a name="322015">Boolean. True if the first duration is longer than the second duration; returns false otherwise.</a></p>
      <p class="N_sb_ScanBold"><a name="322016">Examples</a></p>
      <p class="b_Body"><a name="322017">The following expressions compare the lengths of specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="321518">BirtDuration.isLongerThan( "P1Y3M" ,  "P13M" ) // returns true</a></div>
      <div class="co_Code"><a name="321519">BirtDuration.isLongerThan( "P2M" ,  "P62D" ) // returns false</a></div>
      <div class="co_Code"><a name="321520">BirtDuration.isLongerThan( "PT25H" ,  "P1D" ) // returns true</a></div>
      <h3 class="RH2_Method"><a name="322168">BirtDuration.isShorterThan</a></h3>
      <p class="b_Body"><a name="322169">This function tests if a duration is shorter than another duration. Sometimes the order relationship between certain durations cannot be determined, for example, one month (P1M) and 30 days (P30D), or one year (P1Y) and 365 days (P365D). In cases such as these, the function returns false.</a></p>
      <p class="N_sb_ScanBold"><a name="322170">Syntax</a></p>
      <div class="rs_RSyntax"><a name="322171">boolean BirtDuration.isShorterThan( string lexicalDuration1, string lexicalDuration2 )</a></div>
      <p class="N_sb_ScanBold"><a name="322172">Parameters</a></p>
      <p class="RParameter"><a name="322173">lexicalDuration1</a></p>
      <p class="bn_BodyNoLead"><a name="322174">String. The first duration to use in the comparison.</a></p>
      <p class="RParameter"><a name="322175">lexicalDuration2</a></p>
      <p class="bn_BodyNoLead"><a name="322176">String. The second duration to use in the comparison.</a></p>
      <p class="N_sb_ScanBold"><a name="322177">Returns</a></p>
      <p class="b_Body"><a name="322178">Boolean. True if the first duration is shorter than the second duration; returns false otherwise.</a></p>
      <p class="N_sb_ScanBold"><a name="322179">Examples</a></p>
      <p class="b_Body"><a name="322180">The following expressions compare the lengths of specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="322181">BirtDuration.isShorterThan( "P1Y3M" ,  "P13M" ) // returns false</a></div>
      <div class="co_Code"><a name="322182">BirtDuration.isShorterThan( "P2M" ,  "P62D" ) // returns false</a></div>
      <div class="co_Code"><a name="322183">BirtDuration.isShorterThan( "PT25H" ,  "P1D" ) // returns false</a></div>
      <div class="co_Code"><a name="322228">BirtDuration.isShorterThan( "P27D" , "P1M" ) // returns true</a></div>
      <h3 class="RH2_Method"><a name="320752">BirtDuration.minute</a></h3>
      <p class="b_Body"><a name="320753">This function returns the minutes value of a given duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320754">Syntax</a></p>
      <div class="rs_RSyntax"><a name="320755">integer BirtDuration.minute( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="320756">Parameter</a></p>
      <p class="RParameter"><a name="320757">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="320758">String. A duration from which to get the minutes value.</a></p>
      <p class="N_sb_ScanBold"><a name="320759">Returns</a></p>
      <p class="b_Body"><a name="320760">Integer. A number that represents the minutes value of the specified duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320761">Examples</a></p>
      <p class="b_Body"><a name="320762">The following examples show the minutes values returned for specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="320763">BirtDuration.minute( "P1Y15DT12H30M45S" ) // returns 30</a></div>
      <div class="co_Code"><a name="320849">BirtDuration.minute( "P5Y2M8DT15H" ) // returns 0</a></div>
      <h3 class="RH2_Method"><a name="320850">BirtDuration.month</a></h3>
      <p class="b_Body"><a name="320851">This function returns the months value of a given duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320852">Syntax</a></p>
      <div class="rs_RSyntax"><a name="320817">integer BirtDuration.month( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="320818">Parameter</a></p>
      <p class="RParameter"><a name="320819">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="320820">String. A duration from which to get the months value.</a></p>
      <p class="N_sb_ScanBold"><a name="320821">Returns</a></p>
      <p class="b_Body"><a name="320822">Integer. A number that represents the months value of the specified duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320823">Examples</a></p>
      <p class="b_Body"><a name="320824">The following examples show the month values returned for specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="320825">BirtDuration.month( "P1Y3M15DT12H30M45S" ) // returns 3</a></div>
      <div class="co_Code"><a name="320826">BirtDuration.month( "P5Y8DT15H" ) // returns 0</a></div>
      <h3 class="RH2_Method"><a name="356432">BirtDuration.multiply</a></h3>
      <p class="b_Body"><a name="356433">This function returns the product of a duration and a regular number.</a></p>
      <p class="N_sb_ScanBold"><a name="356434">Syntax</a></p>
      <div class="rs_RSyntax"><a name="356435">string BirtDuration.multiply( string lexicalDuration, integer factor )</a></div>
      <p class="N_sb_ScanBold"><a name="356436">Parameter</a></p>
      <p class="RParameter"><a name="356437">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="356438">String. A duration to multiply.</a></p>
      <p class="RParameter"><a name="356501">factor</a></p>
      <p class="bn_BodyNoLead"><a name="356502">Integer. A regular number to multiply.</a></p>
      <p class="N_sb_ScanBold"><a name="356477">Returns</a></p>
      <p class="b_Body"><a name="356478">String. The product of the input duration and the factor.</a></p>
      <p class="N_sb_ScanBold"><a name="356441">Examples</a></p>
      <p class="b_Body"><a name="356442">The following examples show the products returned fora specific duration and factor:</a></p>
      <div class="cf_CodeFirst"><a name="356443">BirtDuration.multiply( "P1Y3M15DT12H30M45S", 1) </a></div>
      <div class="co_Code"><a name="356539">// returns P1Y3M15DT12H30M45S</a></div>
      <div class="co_Code"><a name="356444">BirtDuration.multiply( "P5Y8DT15H", 0) // returns P0Y0DT0H</a></div>
      <h3 class="RH2_Method"><a name="356559">BirtDuration.negate</a></h3>
      <p class="b_Body"><a name="356560">This function returns the negative value of a duration.</a></p>
      <p class="N_sb_ScanBold"><a name="356561">Syntax</a></p>
      <div class="rs_RSyntax"><a name="356562">string BirtDuration.negate( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="356563">Parameter</a></p>
      <p class="RParameter"><a name="356564">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="356565">String. A duration to negate.</a></p>
      <p class="N_sb_ScanBold"><a name="356568">Returns</a></p>
      <p class="b_Body"><a name="356569">String. The negative value of the input duration.</a></p>
      <p class="N_sb_ScanBold"><a name="356570">Examples</a></p>
      <p class="b_Body"><a name="356571">The following examples show the negative result from a specific duration:</a></p>
      <div class="cf_CodeFirst"><a name="356572">BirtDuration.negate( "P1Y3M15DT12H30M45S") </a></div>
      <div class="co_Code"><a name="356573">// returns -P1Y3M15DT12H30M45S</a></div>
      <h3 class="RH2_Method"><a name="320871">BirtDuration.second</a></h3>
      <p class="b_Body"><a name="320872">This function returns the seconds value of a given duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320873">Syntax</a></p>
      <div class="rs_RSyntax"><a name="320874">integer BirtDuration.second( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="320875">Parameter</a></p>
      <p class="RParameter"><a name="320876">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="320877">String. A duration from which to get the seconds value.</a></p>
      <p class="N_sb_ScanBold"><a name="320878">Returns</a></p>
      <p class="b_Body"><a name="320879">Integer. A number that represents the seconds value of the specified duration.</a></p>
      <p class="N_sb_ScanBold"><a name="320880">Examples</a></p>
      <p class="b_Body"><a name="320881">The following examples show the seconds values returned for specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="320882">BirtDuration.second( "P1Y3M15DT12H30M45S" ) // returns 5</a></div>
      <div class="co_Code"><a name="320883">BirtDuration.second( "P5Y8DT15H" ) // returns 0</a></div>
      <h3 class="RH2_Method"><a name="356891">BirtDuration.subtract</a></h3>
      <p class="b_Body"><a name="356892">This function subtracts a duration from another duration.</a></p>
      <p class="N_sb_ScanBold"><a name="356893">Syntax</a></p>
      <div class="rs_RSyntax"><a name="356894">string BirtDuration.subtract( string lexicalDuration1, string lexicalDuration2 )</a></div>
      <p class="N_sb_ScanBold"><a name="356895">Parameters</a></p>
      <p class="RParameter"><a name="356896">lexicalDuration1</a></p>
      <p class="bn_BodyNoLead"><a name="356897">String. The duration to subtract from.</a></p>
      <p class="RParameter"><a name="356898">lexicalDuration2</a></p>
      <p class="bn_BodyNoLead"><a name="356899">String. The duration subtracted from lexicalDuration1.</a></p>
      <p class="N_sb_ScanBold"><a name="356900">Returns</a></p>
      <p class="b_Body"><a name="356901">String. The difference of the two input durations.</a></p>
      <p class="N_sb_ScanBold"><a name="356902">Examples</a></p>
      <p class="b_Body"><a name="356903">The following example subtracts two durations:</a></p>
      <div class="cf_CodeFirst"><a name="356904">BirtDuration.subtract("P1Y3M", "P13M") // returns P0Y2M</a></div>
      <h3 class="RH2_Method"><a name="321357">BirtDuration.timeInMills</a></h3>
      <p class="b_Body"><a name="321358">This function returns the number of milliseconds in a given duration, from a specified start date. The number of milliseconds in a duration can change depending on the start date. For example, a duration of one month can be 28, 29, 30, or 31 days, depending on the start date. If the start date is January 1, the function calculates the milliseconds between January 1 and February 1 (excluding February 1), which equals 2678400000 millseconds or 31 days. If the start date is February 1, 2009 (a leap year), the function calculates the milliseconds between February 1 and March 1, which equals 2505600000 milliseconds or 29 days.</a></p>
      <p class="N_sb_ScanBold"><a name="321359">Syntax</a></p>
      <div class="rs_RSyntax"><a name="321360">Number BirtDuration.timeInMills( string lexicalDuration, Date startDate )</a></div>
      <p class="N_sb_ScanBold"><a name="321361">Parameters</a></p>
      <p class="RParameter"><a name="321362">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="321363">String. A duration whose length in milliseconds to get.</a></p>
      <p class="RParameter"><a name="321405">startDate</a></p>
      <p class="bn_BodyNoLead"><a name="321415">Date object. Represents the start date.</a></p>
      <p class="N_sb_ScanBold"><a name="321364">Returns</a></p>
      <p class="b_Body"><a name="321365">Number object. The number of milliseconds in the specified duration.</a></p>
      <p class="N_sb_ScanBold"><a name="321366">Examples</a></p>
      <p class="b_Body"><a name="321367">The following examples show the number of milliseconds returned for specific durations and start dates:</a></p>
      <div class="cf_CodeFirst"><a name="321368">BirtDuration.timeInMills( "P1Y3M10D" ,  "2009-01-01" ) // returns 40172400000</a></div>
      <div class="co_Code"><a name="321369">BirtDuration.timeInMills( "P1Y3M10D" ,  "2008-01-01" ) // returns 40258800000</a></div>
      <div class="co_Code"><a name="321467">BirtDuration.timeInMills( "PT6H45M20S" ,  "2009-01-01" ) // returns 24320000</a></div>
      <h3 class="RH2_Method"><a name="321213">BirtDuration.year</a></h3>
      <p class="b_Body"><a name="321214">This function returns the year value of a given duration.</a></p>
      <p class="N_sb_ScanBold"><a name="321215">Syntax</a></p>
      <div class="rs_RSyntax"><a name="321216">integer BirtDuration.year( string lexicalDuration )</a></div>
      <p class="N_sb_ScanBold"><a name="321217">Parameter</a></p>
      <p class="RParameter"><a name="321218">lexicalDuration</a></p>
      <p class="bn_BodyNoLead"><a name="321219">String. A duration from which to get the year value.</a></p>
      <p class="N_sb_ScanBold"><a name="321220">Returns</a></p>
      <p class="b_Body"><a name="321221">Integer. A number that represents the year value of the specified duration.</a></p>
      <p class="N_sb_ScanBold"><a name="321222">Examples</a></p>
      <p class="b_Body"><a name="321223">The following examples show the year values returned for specific durations:</a></p>
      <div class="cf_CodeFirst"><a name="321224">BirtDuration.year( "P1Y3M15DT12H30M45S" ) // returns 1</a></div>
      <div class="co_Code"><a name="321225">BirtDuration.year( "P8DT15H" ) // returns 0</a></div>
    </blockquote>
    <hr align="left" />
    <table align="right" summary="">
      <tr>
        <td class="WebWorks_Company_Name_Bottom">
          <a href="notices.html">(c) Copyright Actuate Corporation 2013</a>
        </td>
      </tr>
    </table>
  </body>
</html>